package com.csnf.hymall.service.impl;

import com.csnf.hymall.dao.ProductOrderMapper;
import com.csnf.hymall.dao.imp.ProductOrderMapperImp;
import com.csnf.hymall.service.ProductOrderService;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ProductOrderServiceImpl implements ProductOrderService {
    ProductOrderMapper productOrderMapper = new ProductOrderMapperImp();
    @Override
    public int getOrderTotal(String startDate, String endDate, int state) {

            if (startDate == null || endDate == null) {
                startDate ="2010-01-01 00:00:00";
                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS");
                endDate = simpleDateFormat.format(new Date());//当前时间
            }
            return productOrderMapper.getOrderTotal(startDate,endDate,state);
        }
    }

